#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
void fun(int m, int* k, int xx[])
{
	int  h = 0; int j = 0; int c = 0;

	for (c = 0; c < m; c++)
	{
		int f = sqrt(c);
		for (h = 2; h <= f; h++)
		{
			if (c % h == 0)
			{
				xx[j] = c;
				(*k)++;
				j++;
				break;
			}
		}
	}


}
int main()
{
	int m = 0; int k = 0;
	int xx[1000] = { 0 };
	scanf("%d", &m);
	fun(m, &k, xx);
	int j = 0;
	printf("%d\n", k);
	for (j = 0; j < k; j++)
	{
		if (xx[j] != 0)
		{
			printf("%d ", xx[j]);
		}
	}
	return 0;
}